<template>
  <div id="search_container">
      <el-input type="text"  placeholder="请输入你要查找的关键词" v-model="inputObject.userInput" :id="inputObject.inputId"/>
      <el-button id="searchBtn" @click="send">search</el-button>
  </div>
</template>

<script>
import bus from '@/bus/bus'
export default {
 data(){
   return {
    inputObject:{
       userInput:'',
     inputId:'searchInput'
    }
   }
 },
 methods:{
   send(){
     bus.$emit('shareUserInput',this.inputObject)
   }
 },
 mounted(){
   this.send()
 }
}
</script>

<style lang="less" scoped>
#search_container{
  height: 100%;
  width: 100%;
  display: flex;
}
input{
  height: 30px;
  width: 100%;
}
#searchBtn{
  height: 38px;
  width: 120px;
  margin-left: 10px;

}
</style>